package demo1;

public class Test {
    public static void eat(Animal animal){
        animal.eat();
    }
    public static void main(String[] args) {
        Animal a1=new Cat("hzp",18);
        Animal a2=new Dog("hhh",18);
        Animal a3=new Animal("xxx",18);
        eat(a1);
        eat(a2);
        eat(a3);
    }
}
